package com.example.dllo.baidumusic.nettool;
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         佛祖保佑       永无BUG
*/

import android.os.Bundle;

import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import cn.bmob.v3.Bmob;

/**
 * Created by dllo on 16/8/15.
 */
public abstract class BaseActivity extends AppCompatActivity implements View.OnClickListener {
    protected NetTool netTool;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setLayout());
        Bmob.initialize(this, "ff261edc10ca4a638d4f5a53c4130e65");
        initView();
        initData();
        netTool = new NetTool(this);

    }

    @Override
    protected void onDestroy() {
        netTool.onDestroy();
        super.onDestroy();
    }

    protected abstract int setLayout();

    protected abstract void initView();

    protected abstract void initData();

    //简化findViewById
    protected <T extends View> T bindView(int id) {
        return (T) findViewById(id);
    }

}
